function SuperType(str){
  this.str = str??'none'
  this.arr = [1,2,3]
  this.fn = ()=>console.log(1)
}
SuperType.prototype.fn2 = ()=>console.log(2)
const superType = new SuperType('superType')
console.log(superType)

function SubType (num,str){
  this.num = num
  SuperType.call(this,str)
}

/**
 * 优点：父类引用属性不会共享
 *       构造可以传参
 * 缺点：父类原型方法不会共享
 */


const subType = new SubType(123,'123')
console.log(subType)
superType.fn2()
subType.fn2()